Skip to content

Conversation

sergiolms
Copy link
Contributor

@sergiolms sergiolms commented Nov 18, 2024

Description

This PR introduces a new option in the Commit Graph context menu for resetting the current branch to a tag.
Captura de pantalla 2024-11-18 a las 12 30 59

Solves #2373

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

@sergiolms sergiolms self-assigned this Nov 18, 2024
Copy link
Contributor

@axosoft-ramint axosoft-ramint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well! Just very minor nitpicks and one suggestion about adding a condition to a when clause - otherwise, LGTM

package.json Outdated
Comment on lines 9081 to 9087
{
"command": "gitlens.graph.resetToTag",
"title": "Reset Current Branch to Tag...",
"category": "GitLens",
"icon": "$(gitlens-reset)",
"enablement": "!operationInProgress"
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor nitpick: I know our package JSON is basically the "wild west" right now, and ordering is scrambled for the most part, but just to help the situation a touch, can we put this next to where the other gitlens.graph.reset... commands are?

"command": "gitlens.graph.switchToTag",
"when": "false"
},
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

package.json Outdated
Comment on lines 16426 to 16430
{
"command": "gitlens.graph.resetToTag",
"when": "!gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && webviewItem =~ /gitlens:tag\\b/",
"group": "1_gitlens_actions@2"
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may also want to add !listMultiSelection to the "when" clause here to make sure we're not in a multi-selection context.

Copy link
Contributor

@axosoft-ramint axosoft-ramint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sergiolms sergiolms merged commit cf33c45 into main Nov 20, 2024
3 checks passed
@sergiolms sergiolms deleted the feature/reset_branch_to_tag branch November 20, 2024 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants